<!DOCTYPE html>

<html
<head>
	<title>Simple 3D example</title>
	<style>
    div {
	    height: 150px; width: 150px;
	  }
	  .container {
      border: 1px solid black;
      margin: 20px;
      background-color: rgba(0, 0, 0, 0.1);
      -webkit-perspective: 500px;
      -moz-perspective: 500px;
      -ms-perspective: 500px;
      -o-perspective: 500px;
      perspective: 500px;
	  }
	  .transformed {
      -webkit-transform: rotateY(50deg);
      -moz-transform: rotateY(50deg);
      -ms-transform: rotateY(50deg);
      -o-transform: rotateY(50deg);
      transform: rotateY(50deg);
      
      -webkit-transform-style: preserve-3d;
      -moz-transform-style: preserve-3d;
      -ms-transform-style: preserve-3d;
      -o-transform-style: preserve-3d;
      transform-style: preserve-3d;

      background-color: blue;
	  }
	  .child {
      -webkit-transform-origin: top left;
      -webkit-transform: rotateX(40deg);
      -moz-transform: rotateX(40deg);
      -ms-transform: rotateX(40deg);
      -o-transform: rotateX(40deg);
      transform: rotateX(40deg);
      background-color: lime;
	  }
	</style>
</head>
<body>
  <div class="container">
    <div class="transformed">
      <div class="child"></div>
    </div>
  </div>
</body>
</html>
